package com.bitin.module.payment.domain.entity;

import com.bitin.common.data.model.AbstractAuditModel;
import com.bitin.module.payment.domain.enumeration.PaymentState;
import jakarta.persistence.*;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Mr.Lu
 * @Datetime 2024/8/13 22:56
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@Table
public class PaymentInstallment extends AbstractAuditModel {
    /**
     * 总分期数
     */
    private Integer total;
    /**
     * 当前期数
     */
    private Integer current;
    /**
     * 付款金额
     */
    private BigDecimal amount;
    /**
     * 付款状态
     */
    @Enumerated(value = EnumType.STRING)
    private PaymentState state;

    /**
     * 付款时间
     */
    private LocalDateTime paymentTime;
    /**
     * 支付凭证
     */
    @ElementCollection(fetch = FetchType.EAGER)
    private List< String > vouchers = new ArrayList<>();
}
